Hackerrank – Bon Appétit

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

First find a correct amount of money – (food_sum - index_of_allergic) / 2.
Compare if the correct amount is equals with given amount.

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *